Skip to content

Conversation

@JesterX666
Copy link
Contributor

@JesterX666 JesterX666 commented Oct 19, 2025

About the PR

Closes #40902
Added admin logs for radial menu interactions of the RCD

Why / Balance

Logging, see issue #40845

Technical details

Added logging

Media

image

Requirements

Breaking changes

Changelog

  • added admin logging for RCD menu interactions

@PJBot PJBot added S: Untriaged Status: Indicates an item has not been triaged and doesn't have appropriate labels. S: Needs Review Status: Requires additional reviews before being fully accepted. Not to be replaced by S: Approved. size/S Denotes a PR that changes 10-99 lines. labels Oct 19, 2025
Copy link
Member

@beck-thompson beck-thompson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good! Could you make it log an error if there its RcdMode.Invalid or default?

@PJBot PJBot added S: Awaiting Changes Status: Changes are required before another review can happen and removed S: Needs Review Status: Requires additional reviews before being fully accepted. Not to be replaced by S: Approved. labels Oct 19, 2025
@Kowlin Kowlin added P2: Raised Priority: Item has a raised priority, indicating it might get increased maintainer attention. D3: Low Difficulty: Some codebase knowledge required. A: Admin Tooling Area: Admin tooling and moderation. T: Of Admin Interest Type: Affects administration work a lot, and might require admins to weigh in on and removed S: Untriaged Status: Indicates an item has not been triaged and doesn't have appropriate labels. labels Oct 19, 2025
Comment on lines 97 to 109
var prototype = _protoManager.Index(component.ProtoId);
switch (prototype.Mode)
{
case RcdMode.ConstructTile:
_adminLogger.Add(LogType.RCD, LogImpact.Low, $"{ToPrettyString(args.Actor):user} set RCD mode to: Construct Tile : {prototype.Prototype}");
break;
case RcdMode.ConstructObject:
_adminLogger.Add(LogType.RCD, LogImpact.Low, $"{ToPrettyString(args.Actor):user} set RCD mode to: Construct Object : {prototype.Prototype}");
break;
case RcdMode.Deconstruct:
_adminLogger.Add(LogType.RCD, LogImpact.Low, $"{ToPrettyString(args.Actor):user} set RCD mode to: Deconstruct");
break;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not just

Image
Suggested change
var prototype = _protoManager.Index(component.ProtoId);
switch (prototype.Mode)
{
case RcdMode.ConstructTile:
_adminLogger.Add(LogType.RCD, LogImpact.Low, $"{ToPrettyString(args.Actor):user} set RCD mode to: Construct Tile : {prototype.Prototype}");
break;
case RcdMode.ConstructObject:
_adminLogger.Add(LogType.RCD, LogImpact.Low, $"{ToPrettyString(args.Actor):user} set RCD mode to: Construct Object : {prototype.Prototype}");
break;
case RcdMode.Deconstruct:
_adminLogger.Add(LogType.RCD, LogImpact.Low, $"{ToPrettyString(args.Actor):user} set RCD mode to: Deconstruct");
break;
}
var prototype = _protoManager.Index(component.ProtoId);
_adminLogger.Add(LogType.RCD, LogImpact.Low, $"{ToPrettyString(args.Actor):user} set RCD mode to: {prototype.Mode} : {prototype.Prototype}");

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that's fine

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adjusted with @ArtisticRoomba excellent suggestion

Here is what it looks like:

image

@lzk228
Copy link
Contributor

lzk228 commented Oct 20, 2025

@PJBot PJBot added size/XS Denotes a PR that changes 0-9 lines. and removed size/S Denotes a PR that changes 10-99 lines. labels Oct 21, 2025
// Set the current RCD prototype to the one supplied
component.ProtoId = args.ProtoId;

var prototype = _protoManager.Index(component.ProtoId);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

combine this with the HasIndex above into a _protoManager.Resolve

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A: Admin Tooling Area: Admin tooling and moderation. D3: Low Difficulty: Some codebase knowledge required. P2: Raised Priority: Item has a raised priority, indicating it might get increased maintainer attention. S: Awaiting Changes Status: Changes are required before another review can happen size/XS Denotes a PR that changes 0-9 lines. T: Of Admin Interest Type: Affects administration work a lot, and might require admins to weigh in on

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RCD Radial menu interactions aren't logged

7 participants